package btanalyzer.db.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

@Entity
@Table(name = "RESOURCE_FILE")
public class ResourceFile {

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq")
	@SequenceGenerator(name = "seq", sequenceName = "RESOURCE_FILE_SEQ")
	@Column(name = "RESOURCE_FILE_ID")
	private Long id;
	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return id;
	}

	@NotNull
	@Column(name="RELATIVE_PATH")
	private String relativePath;
	public void setRelativePath(String relativePath) {
		this.relativePath = relativePath;
	}
	public String getRelativePath() {
		return relativePath;
	}

	@NotNull
	@Column(name="ORDER_NUMBER")
	private Integer orderNumber;
	public void setOrderNumber(Integer orderNumber) {
		this.orderNumber = orderNumber;
	}
	public Integer getOrderNumber() {
		return orderNumber;
	}
	
	@NotNull
	@ManyToOne
	@JoinColumn(name="METADATA_ID")
	private Metadata metadata;
	public void setMetadata(Metadata metadata) {
		this.metadata = metadata;
	}
	public Metadata getMetadata() {
		return metadata;
	}

}
